package ihc.terminalbanco.gui.panels;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.Border;

public class InformeAgendaPane extends JPanel implements RotulosInterface{

	/**
	 * 
	 */
	private static final long serialVersionUID = -7977141560450634588L;

	public InformeAgendaPane (ActionListener actionListener, Font font) {
		
		this.setLayout(new BorderLayout());
		
		Border raisedbevel = BorderFactory.createRaisedBevelBorder();
		/*
		 * Panels
		 */
		//CENTER
				
//		JPanel painelCentralSuperior = new JPanel();
//		painelCentralSuperior.setLayout(new FlowLayout(FlowLayout.CENTER));
		
		JLabel informe = new JLabel("INFORME:");
		informe.setFont(font);
//		painelCentralSuperior.add(informe);
		
		JPanel painelCentralPai = new JPanel();
		painelCentralPai.setLayout(new GridLayout(3, 1, 10, 40));
						
		JPanel painelCentralFilhoEntrada = new JPanel();
		painelCentralFilhoEntrada.setLayout(new GridLayout(1, 2));
				
		
		JLabel comprovDia = new JLabel("Comprov. do dia: ");
		JTextField entradaData = new JTextField();
		
		
		painelCentralFilhoEntrada.add(comprovDia);
		painelCentralFilhoEntrada.add(entradaData);
		
		
		painelCentralFilhoEntrada.setBorder(raisedbevel);
		
		JLabel dataNaoMaior = new JLabel("Data NÃO maior");
		dataNaoMaior.setFont(font);
		Date hoje = new Date();
		SimpleDateFormat formatador = new SimpleDateFormat("dd/MM/yy");  
		JLabel doQueHoje = new JLabel("do que " + formatador.format(hoje));
		doQueHoje.setFont(font);
		
		JPanel informePanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
		informePanel.add(informe);
		
		JPanel informacao = new JPanel(new GridLayout(2,1));
		
		JPanel dataNaoMaiorPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
		dataNaoMaiorPanel.add(dataNaoMaior);
		JPanel doQueHojePanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
		doQueHojePanel.add(doQueHoje);

		painelCentralPai.add(informePanel);
		painelCentralPai.add(painelCentralFilhoEntrada);
		informacao.add(dataNaoMaiorPanel);
		informacao.add(doQueHojePanel);
		painelCentralPai.add(informacao);
		
		
		
        //SOUTH
        JPanel painelSul = new JPanel();
        painelSul.setLayout(new GridLayout(1, 2, 100, 0));

        JButton sairButton = new JButton(anularString);
        sairButton.setFont(font);
        sairButton.setVisible(true);
        sairButton.addActionListener(actionListener);
        painelSul.add(sairButton);

        JButton confirmarButton = new JButton(confirmarString);
        confirmarButton.setFont(font);
        confirmarButton.setVisible(true);
        confirmarButton.addActionListener(actionListener);
        painelSul.add(confirmarButton);
        painelSul.setPreferredSize(new Dimension(480, 100));
		
		//Juntando
		JPanel painelCentralPrincipal = new JPanel();
		painelCentralPrincipal.setLayout(new GridLayout(1, 1));
//		painelCentralPrincipal.add(painelCentralSuperior);
		painelCentralPrincipal.add(painelCentralPai);
		
		this.add(painelCentralPrincipal, BorderLayout.CENTER);
		this.add(painelSul, BorderLayout.SOUTH);
		
		
	}
	
}
